package com.kiven.xml.jaxb;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 第一步：创建要转化的java对象，该对象需要使用相关注解注释各字段（标注在get方法上）。
 * 
 * @author kiven
 *
 */

@XmlRootElement
public class Customer {
	private String name;
	private int age;
	private int id;
	
	@XmlElement
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	@XmlElement
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	
	@XmlAttribute
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	@Override
	public String toString() {
		return "Customer [id=" + id +",name=" + name +",age=" + age + "]";
	}
}
